<template>
  <div>
      <my-head title="" :back="false"></my-head>
    <ul v-for="(v, i) in oppofind" :key="i">
      <li v-for="(vs, is) in v" :key="is">
        <router-link :to="{ name: 'good', query: { skuId: vs.skuId } }">
          <img :src="vs.mainImg" class="limg" alt="" />
          <div class="right">
            <h2>{{ vs.spuName }}</h2>
            <p>
              <span>{{ vs.spuShortDesc }}</span>
            </p>
            <span class="name van-ellipsis">￥{{ vs.price.price }}</span>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      oppofind: [],
    };
  },
  methods: {
    async getOPfind() {
      let res = await this.$ajax.getOPfl2();
      // console.log(res);
      // console. log(res.data[1]);
      let obj = [];

      for (var i = 0; i < res.data.length; i++) {
        console.log(res.data[i].category.goods);
        obj[i] = res.data[i].category.goods;
      }
      this.oppofind = obj;
      console.log(this.oppofind);

      // return obj;
    //   console.log(this.oppofind);
    },
  },
  mounted() {
    this.getOPfind();
  },
};
</script>

<style lang="scss" scoped>
ul {
  width: 100%;
  li {
    box-shadow: 0 0 2px 0.5px #b5b5b5;
    overflow: hidden;
    border-radius: 10px;
    padding-left: 40px;
    a {
      text-decoration: none;

      .limg {
        // width: 100%;
        // height: 150px;
        float: left;
      }
      .right {
        float: left;
        margin-top: 30px;
        .name {
          width: 100%;
          padding: 0 15px;
          font-size: 20px;
          color: #999;
          margin: 10px 0;
        }
        p {
          width: 100%;
          padding: 0 15px;
          display: flex;
          justify-content: space-between;
          padding: 0 10px;
        }
      }
    }
  }
}
h2{
    margin-left: 12px;
    color: #000;

}
span{
  color: #000;
}

</style>